#ifndef _IOT_BEARER_H_
#define _IOT_BEARER_H_

typedef enum
{
    IOT_BEARER_OK                  = 0,  /* success */
    IOT_BEARER_ERROR               = -1, /* error */
    IOT_BEARER_WOULDBLOCK          = -2, /* would block */
    IOT_BEARER_LIMIT_RESOURCE      = -3, /* limited resource */
    IOT_BEARER_INVALID_ACCT_ID     = -4, /* invalid account id*/
    IOT_BEARER_INVALID_AP_ID       = -5, /* invalid application id*/
    IOT_BEARER_INVALID_SIM_ID      = -6, /* invalid SIM id */
    IOT_BEARER_BEARER_FAIL         = -7, /* bearer fail */
    IOT_BEARER_DHCP_ERROR          = -8, /* DHCP get IP error */
    IOT_BEARER_CANCEL_ACT_BEARER   = -9, /* cancel the account query screen, such as always ask or bearer fallback screen */
    IOT_BEARER_DISC_BY_CM          = -10 /* bearer is deactivated by the connection management */
}iot_E_BearerErrorCode;

typedef enum
{
    IOT_BEARER_STATUS_DEACTIVATED             = 0x01, /* deactivated */
    IOT_BEARER_STATUS_ACTIVATING              = 0x02, /* activating */
    IOT_BEARER_STATUS_ACTIVATED               = 0x04, /* activated */
    IOT_BEARER_STATUS_DEACTIVATING            = 0x08, /* deactivating */
    IOT_BEARER_STATUS_CSD_AUTO_DISC_TIMEOUT   = 0x10, /* csd auto disconnection timeout */
    IOT_BEARER_STATUS_GPRS_AUTO_DISC_TIMEOUT  = 0x20, /* gprs auto disconnection timeout */
    IOT_BEARER_STATUS_NWK_NEG_QOS_MODIFY      = 0x040, /* negotiated network qos modify notification */
    IOT_BEARER_STATUS_WIFI_STA_INFO_MODIFY    = 0x080, /* wifi hot spot sta number is changed */
    IOT_BEARER_STATUS_BEARER_STATE_TOTAL
}iot_E_BearerStatus;

typedef void(* iot_bearerStateNotifyFuncPtr)(iot_int32_t state, iot_uint8_t * addr);

extern void iot_setBearerStateNotifyFunc(iot_bearerStateNotifyFuncPtr ptr);
extern iot_int8_t iot_bearerOpen(iot_uint8_t *apn);
extern iot_int8_t iot_bearerHold();
extern iot_int8_t iot_bearerRelease();
extern iot_int32_t iot_getBearerStatus();

#endif
